def star_segment(func):
    """
    decorator which encloses printed contents with stars
    :param func:
    :return:
    """
    def _star_segment(content):
        print '********************************************************************************'
        func(content)
        print '********************************************************************************'
    return _star_segment


def loop_increase(integer, base):
    """
    increase integer by 1 if it exceeds base then reset integer
    :param integer:
    :param base:
    :return:
    """
    return (integer + 1) % base


@star_segment
def emphasis_print(content):
    print content


def log_to_file(file_name, content):
    with open(file_name, 'w') as writer:
        writer.write(content)


